package org.hy.persistence.global;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.hy.domain.User;
import org.hy.domain.global.PMessage;

public interface PMessageMapper {
	PMessage findPMessageById(Integer id);
	
	List<PMessage> findPMessagesByUid(@Param("uid") int uid,@Param("offset")int offset,@Param("size")int size);
	
	int insertPMessage(PMessage pMessage);
	
	int updatePMessage(PMessage pMessage);
	
	int deletePMessage(Integer id);
	
	/**
	 * 统计用户的私信数
	 * @param uid
	 * @return
	 */
	int countPMessages(int uid);
	
	/**
	 * 统计用户未读私信数
	 * @param uid
	 * @return
	 */
	int countPMessagesUnRead(int uid);
}
